<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="/layui-v2.7.2/layui/css/layui.css">
    <script src="/layui-v2.7.2/layui/layui.js"></script>
</head>

<body>
    <div class="layui-container">
        <h3>添加班级</h3>
        <form class="layui-form" action="/addClass" method="post">
            <div class="layui-form-item">
                <label class="layui-form-label">班级</label>
                <div class="layui-input-block">
                    <input type="text" name="className" required lay-verify="required" placeholder="请输入班级名称"
                        autocomplete="off" class="layui-input">
                </div>
            </div>

            <div class="layui-form-item">
                <div class="layui-input-block">
                    <button class="layui-btn" lay-submit lay-filter="formDemo">立即提交</button>

                </div>
            </div>
        </form>
    </div>

    <script>
        //Demo
        layui.use('form', function () {
            var form = layui.form;

            //提交
            // form.on('submit(formDemo)', function(data){
            //   layer.msg(JSON.stringify(data.field));
            //   return false;
            // });
        });
    </script>
</body>

</html>